1. Field of the Invention
The present invention generally relates to a tone generating method of generating waveform data by computation and a music apparatus utilizing the tone generating method.
2. Description of Related Art
A conventional tone generator is composed of a MIDI (Musical Instrument Digital Interface), a performance input block for inputting performance information from a keyboard or a sequencer, a tone generating block for generating waveforms of musical tones, and a microprocessor (hereafter, referred to as CPU) for controlling the tone generating block according to the inputted performance information. The CPU executes tone generating driver process including channel assignment and parameter conversion according to the inputted performance information. Further, the CPU supplies information about the converted tone generating parameters and information about sounding start command (namely, note-on) to channels assigned in the tone generating block. The tone generating block is constituted by electronic circuits (namely, hardware) including an LSI (Large Scale Integrated Circuit), and generates waveforms of musical tones or voices based on the supplied tone generating parameters. Therefore, the conventional tone generator is dedicated to generation of musical tones or voices. This requires to separately prepare a dedicated tone generator to generate tones in a personal computer, for example.
To solve this problem, a software sound source has been proposed in which a tone generating program is run by the CPU to generate tones based on this program. This software sound source is implemented by a general-purpose computation processing unit (namely, a computer) that can execute application programs such as a game program in addition to the tone generating application program.
FIG. 7 is a block diagram illustrating constitution of a tone generator having the software sound source as described above. In FIG. 7, when a note-on event occurs (not shown in the figure), a central processing unit (CPU) 100 performs computation according to a tone generating program 101 to generate waveform data, and temporarily stores the generated waveform data in a buffer 102. A digital/analog (D/A) converter 103 reads the waveform data from the buffer 102 every time a predetermined D/A conversion moment comes, and converts the read waveform data into an analog waveform signal. The resultant analog waveform signal is supplied to a sound system 104 to be sounded.
However, in the tone generator having the software sound source as described above, a number of tones or voices to be sounded simultaneously depends on the processing speed of the CPU 100 and the processing quantity and sampling frequency fs for generating one sample of the waveform data. For example, given sampling frequency fs=48 kHz, then one sample period is 20.8 ms. All necessary waveform data per one sample must be computed in this sampling period. Actually, however, 20.8 ms cannot be used all by the tone generator because the operating system (OS) takes time for its operation. Moreover, if another application is running, the execution time for that application is required.
In a monophonic sound, one sample of waveform data may only be computed during one sampling period. With a polyphonic sound, it is required to compute waveform data for the same number of samples as the number of musical tones being sounded concurrently at an allocated time. Thus, in case of the polyphonic sound, a computational time allocated for generating one sample of waveform data is decreased. Generally, music is played by use of plural sounding channels, so that a computation time allocated to one sounding channel is shortened. In a short computation time, only simple computation can be performed, thereby preventing tone quality from being enhanced. In programming of a tone generation algorithm for use in a software sound source, it is sometimes required to evaluate a music tone not monophonically but polyphonically. However, if the tone generation algorithm is made complicated, the computation for plural sounding channels may not be completed within an allocated computation time, thereby failing to polyphonically reproduce the music tone for evaluation.